package com.avic.rong.questionOrAnswer.adapter;

import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentStatePagerAdapter;

import java.util.ArrayList;

/**
 * Created by XinEr on 2019/8/7.
 * Describe:
 */
public class PersonHomeVpAdapter extends FragmentStatePagerAdapter {
    private ArrayList<String> titleList;
    private ArrayList<Fragment> fragmentsList;

    public PersonHomeVpAdapter(FragmentManager fm, ArrayList<String> titleList, ArrayList<Fragment> fragments) {
        super(fm);

        this.titleList = titleList;
        this.fragmentsList = fragments;

    }


    @Override
    public Fragment getItem(int i) {
        return fragmentsList.get(i);
    }

    @Override
    public int getCount() {
        return titleList.size();
    }

    @Nullable
    @Override
    public CharSequence getPageTitle(int position) {
        return titleList.get(position);
    }
}
